﻿@model IEnumerable<dynamic>
@{
    Html.Telerik().Grid(Model).Name("gridProperty").Columns(c =>
                                                        {
                                                            c.Bound("ProductPropertyId").Title("#").Width(50);
                                                            c.Bound("Name");
                                                            c.Bound("GroupName");
                                                            c.Bound("Bit").Title("Checked").ClientTemplate("<input <#= Bit #> class=\"check-box\" disabled=\"disabled\" type=\"checkbox\" />");
                                                            c.Bound("Numer").Title("Value");
                                                            c.Bound("Value").Title("Description");
                                                            c.Template(v => v.ProductId).ClientTemplate("<a class=\"t-button t-button-icon t-grid-edit\" href=\"javascript:editProperty(<#=ProductPropertyId#>);\"><span class=\"t-icon t-edit\"></span></a><a class=\"t-button t-button-icon t-grid-delete\" href=\"javascript:deleteProperty(<#=ProductPropertyId#>);\"><span class=\"t-icon t-delete\"></span></a>").Width(80);
                                                        }).Sortable(c => c.Enabled(true)).DataKeys(c => c.Add("ProductPropertyId")).ToolBar(v => v.Custom().ButtonType(GridButtonType.Text).Text("Add New Property").HtmlAttributes(new {
                                                                                                                                                                                                                                                 href = "javascript:addProperty();"
                                                                                                                                                                                                                                         })).Pageable(c =>
                                                                                                                                                                                                                                                          {
                                                                                                                                                                                                                                                              c.Enabled(true);
                                                                                                                                                                                                                                                              c.PageSize(25);
                                                                                                                                                                                                                                                          }).DataBinding(c => c.Ajax().Select("GetPropertyList", "Product", new {
                                                                                                                                                                                                                                                                                                                                         ViewBag.Id
                                                                                                                                                                                                                                                                                                                                 })).Render();
}